<template>
  <div class="navi">
     <van-nav-bar
      :title="title"
      :left-text="leftText"
      
      :fixed="fixed"
      left-arrow
      @click-left="back"
      @click-right="clickRight"
    >
    <template #right :right-text="rightText">
      <van-icon :name="iconName" color="#fff"/>
    </template>

     </van-nav-bar>
    
  </div>
</template>

<script>
export default {
  name: "Navi",
  props: {
    title: {
      type: String,
      default: "",
    },
    leftText: {
      type: String,
      default: "",
    },
    rightText: {
      type: String,
      default: "",
    },
    fixed: {
      type: Boolean,
      default: false,
    },
    iconName:{
      type:String,
      default:""
    }
  },

  methods: {
    back() {
      this.$router.go(-1);
    },
    clickRight() {
      this.$emit("click-right");
    },
  },
};
</script>

<style lang="less" scoped>
.navi {
  /deep/ .van-nav-bar .van-icon {
    color: #aaa;
  }

  /deep/ .van-nav-bar__text {
    color: #aaa;
  }
}
</style>